<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网站设置 - {{ settings.site_title }}</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body class="admin-body">
    <div class="admin-layout">
        <nav class="admin-sidebar">
            <div class="sidebar-header">
                <h3>管理后台</h3>
            </div>
            <ul class="sidebar-menu">
                <li><a href="{{ url_for('admin_dashboard') }}">仪表板</a></li>
                <li><a href="{{ url_for('admin_posts') }}">文章管理</a></li>
                <li><a href="{{ url_for('admin_pages') }}">页面管理</a></li>
                <li><a href="{{ url_for('admin_settings') }}" class="active">网站设置</a></li>
                <li><a href="{{ url_for('admin_logout') }}">退出登录</a></li>
            </ul>
        </nav>

        <main class="admin-main">
            <header class="admin-header">
                <h1>网站设置</h1>
            </header>

            <div class="admin-content">
                {% with messages = get_flashed_messages(with_categories=true) %}
                    {% if messages %}
                        {% for category, message in messages %}
                            <div class="flash-message flash-{{ category }}">{{ message }}</div>
                        {% endfor %}
                    {% endif %}
                {% endwith %}

                <form action="{{ url_for('save_settings') }}" method="post" class="settings-form">
                    <div class="form-group">
                        <label for="site_title">网站标题</label>
                        <input type="text" id="site_title" name="site_title" value="{{ settings.site_title }}" required>
                    </div>

                    <div class="form-group">
                        <label for="site_logo">网站Logo（Emoji或图片URL）</label>
                        <input type="text" id="site_logo" name="site_logo" value="{{ settings.site_logo }}" placeholder="🌟 或 https://example.com/logo.png">
                        <small>可以使用Emoji表情或图片URL</small>
                    </div>

                    <div class="form-group">
                        <label for="description">网站描述</label>
                        <textarea id="description" name="description" rows="3">{{ settings.description }}</textarea>
                    </div>

                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">保存设置</button>
                    </div>
                </form>
            </div>
        </main>
    </div>
</body>
</html>
